package com.why.jvm.hotspot.src.share.vm.oops.constants;

import com.why.jvm.hotspot.src.share.vm.oops.constants.ConstantInfoBase;
import lombok.Data;

/**
 * @author xiaoTian
 * @date 2022/7/22 14:27
 * @Description:
 */
@Data
public class ConstantStringInfo extends ConstantInfoBase {

    private int stringIndex;

    private String getStringValue(){
        return getConstantPool().getConstantPoolMap().get(stringIndex).toString();
    }

    @Override
    public String toString() {
        return "ConstantStringInfo{" +
                "stringIndex=" + stringIndex +
                ",string=" + getStringValue() +
                '}';
    }
}
